<!doctype html>
<html>
<body>
    <div>
        <h3>result:</h3>
        <textarea id="result" rows="3" cols="100"></textarea>
    </div>

    <script src="../../../flycv.js" type="text/javascript"></script>
    <script type="text/javascript">
        let resultHtml = document.getElementById("result");
        fcv.then((fcv) => {
            // mock数据
            let pts1 = new fcv.VectorPoint2f();
            let pts2 = new fcv.VectorPoint2f();

            for (let i = 0; i < 50; i++) {
                pts1.push_back(new fcv.Point2f(i, 2 * i));
                pts2.push_back(new fcv.Point2f(2 * i, 4 * i));
            }

            // 调用
            let result = fcv.findHomography(pts1, pts2, 0);

            // 可视化
            resultHtml.append(result.data());

            // 内存回收
            pts1.delete();
            pts2.delete();
            result.delete();
        });
    </script>
</body>
</html>